package Steam;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.function.Function;

public class Test2 {
    public static void main(String[] args) {
        ArrayList<Student>  list= new ArrayList<>();
        list.add(new Student("hhh",12));
        list.add(new Student("ccc",16));
        list.add(new Student("xxx",15));
        list.add(new Student("qqq",13));


        String[] arr =  list.stream()
                .map(student -> student.getName()+"-"+student.getAge())
                .toArray(String[]::new);

        System.out.println(Arrays.toString(arr));

    }
}
